import request from '@/utils/request'
import {getToken} from '@/utils/auth'
var token = getToken()
//设备列表
export function getequList(data) {
    return request({
        url: '/api/admin/equ',
        method: 'get',
        params:data
    })
}
export function getequtimerList(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-timer-list',
        method: 'post',
        data: newData
    })
}
//设备操作历史列表
export function getequsetList(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/equ-set-list',
        method: 'post',
        data: newData
    })
}
//报警类型

export function getequwarnType() {
    return request({
        url: '/api/admin/equ-warn-type',
        method: 'get',
    })
}
export function getequshow(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/show',
        method: 'post',
        data: newData
    })
}

//添加
export function addto(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/create',
        method: 'post',
        data: newData
    })
}
//修改
export function update(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/edit',
        method: 'post',
        data: newData
    })
}
//删除
export function indelete(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/delete',
        method: 'post',
        data: newData
    })
}

//操作移动指令
//单
export function equmovecommand(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-move-command',
        method: 'post',
        data: newData
    })
}
//批量
export function equbatchmovecommand(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-batch-move-command',
        method: 'post',
        data: newData
    })
}
export function equresult(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-result',
        method: 'post',
        data: newData
    })
}
export function equsetresult(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-set-result',
        method: 'post',
        data: newData
    })
}

//运行模式
//单
export function equswitchcontrol(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-switch-control',
        method: 'post',
        data: newData
    })
}
//批量
export function equbatchswitchcontrol(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-batch-switch-control',
        method: 'post',
        data: newData
    })
}


//清扫模式
//单
export function equsetcleaningmode(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-set-cleaning-mode',
        method: 'post',
        data: newData
    })
}
//批量
export function equbatchsetcleaningmode(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-batch-set-cleaning-mode',
        method: 'post',
        data: newData
    })
}

//参数设置
//单
export function equsetconfig(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-set-config',
        method: 'post',
        data: newData
    })
}

export function equbatchlist(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-batch-list',
        method: 'post',
        data: newData
    })
}
//批量
export function equbatchsetconfig(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-batch-set-config',
        method: 'post',
        data: newData
    })
}


//参数详情
export function equsetshow(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-set-show',
        method: 'post',
        data: newData
    })
}

//定时任务设置
export function equsettimer(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-timer',
        method: 'post',
        data: newData
    })
}
export function equsettimerresult(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-timer-result',
        method: 'post',
        data: newData
    })
}
export function equbatchtimerresult(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-batch-timer',
        method: 'post',
        data: newData
    })
}
export function equtimershow(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-timer-show',
        method: 'post',
        data: newData
    })
}

//启用/禁用
export function equstopstart(formData) {
    let newData = JSON.stringify(formData);
    return request({
        url: '/api/admin/equ/equ-batch-stop-start',
        method: 'post',
        data: newData
    })
}




